﻿using Company.Application.Share.Interfaces;
using Company.Application.Station.Services;
using Company.Application.Station.Views;
using Company.Core.Models;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Company.Application.Station
{
    [Module(ModuleName = nameof(StationModule),OnDemand = true)] //按需加载
    public class StationModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve<IRegionManager>();
            regionManager.RegisterViewWithRegion(Names.MainRegion, typeof(StationView));//注册页面并导航
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<DeviceView>();
            containerRegistry.RegisterSingleton<IStationManager, StationManager>();
        }
    }
}
